package com.java46.struts2.user.action;

import com.java46.struts2.base.action.BaseAction;
import com.java46.struts2.base.exception.BusinessException;
import com.java46.struts2.user.service.TUserService;
import org.apache.struts2.convention.annotation.Action;

/**
 * @ClassName TUserAction
 * @Description 用户操作
 * @Author zuxia
 * @Date 2018/7/16 11:43
 * @Vcrsion 1.0
 **/
public class TUserAction extends BaseAction {


    @Action(value = "userlogin")
    /**
     * @Author xiaobo
     * @Description //用户登陆
     * @Date 9:57 2018/7/17
     * @Param []
     * @return void
     */
    public String userLogin(){
        String uSign="";
        String uName="";
        try{
            uSign=request.getParameter("uSign");
            uName=request.getParameter("uName");
        }catch (Exception e){
            throw new BusinessException("没有接收到用户数据");
        }

        int i = TUserService.userLogin(uSign, uName);
        setSuccesResult(i);
        return "json";
    }

}
